package com.asiainfo.crm.core.web;

import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLSession;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class sslServlet extends HttpServlet {
    private static final Log logger = LogFactory.getLog(sslServlet.class);

    public void init() throws ServletException {
        System.setProperty("java.protocol.handler.pkgs", "localhost");
        HostnameVerifier hv = new HostnameVerifier() {
            public boolean verify(String urlHostName, SSLSession session) {
                logger.warn("no use dns");
                return true;
            }
        };
        HttpsURLConnection.setDefaultHostnameVerifier(hv);
    }
}
